Integrand size = 37, antiderivative size = 63 \[ \int (a+a \cos (c+d x)) \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec (c+d x) \, dx=\frac {1}{2} a (2 A+2 B+C) x+\frac {a A \text {arctanh}(\sin (c+d x))}{d}+\frac {a (B+C) \sin (c+d x)}{d}+\frac {a C \cos (c+d x) \sin (c+d x)}{2 d} \]
[Out]
Time = 0.16 (sec) , antiderivative size = 63, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.108, Rules used = {3112, 3102, 2814, 3855} \[ \int (a+a \cos (c+d x)) \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec (c+d x) \, dx=\frac {a A \text {arctanh}(\sin (c+d x))}{d}+\frac {1}{2} a x (2 A+2 B+C)+\frac {a (B+C) \sin (c+d x)}{d}+\frac {a C \sin (c+d x) \cos (c+d x)}{2 d} \]
[In]
[Out]
Rule 2814
Rule 3102
Rule 3112
Rule 3855
Rubi steps \begin{align*} \text {integral}& = \frac {a C \cos (c+d x) \sin (c+d x)}{2 d}+\frac {1}{2} \int \left (2 a A+a (2 A+2 B+C) \cos (c+d x)+2 a (B+C) \cos ^2(c+d x)\right ) \sec (c+d x) \, dx \\ & = \frac {a (B+C) \sin (c+d x)}{d}+\frac {a C \cos (c+d x) \sin (c+d x)}{2 d}+\frac {1}{2} \int (2 a A+a (2 A+2 B+C) \cos (c+d x)) \sec (c+d x) \, dx \\ & = \frac {1}{2} a (2 A+2 B+C) x+\frac {a (B+C) \sin (c+d x)}{d}+\frac {a C \cos (c+d x) \sin (c+d x)}{2 d}+(a A) \int \sec (c+d x) \, dx \\ & = \frac {1}{2} a (2 A+2 B+C) x+\frac {a A \text {arctanh}(\sin (c+d x))}{d}+\frac {a (B+C) \sin (c+d x)}{d}+\frac {a C \cos (c+d x) \sin (c+d x)}{2 d} \\ \end{align*}
Time = 0.13 (sec) , antiderivative size = 59, normalized size of antiderivative = 0.94 \[ \int (a+a \cos (c+d x)) \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec (c+d x) \, dx=\frac {a (2 c C+4 A d x+4 B d x+2 C d x+4 A \text {arctanh}(\sin (c+d x))+4 (B+C) \sin (c+d x)+C \sin (2 (c+d x)))}{4 d} \]
[In]
[Out]
Time = 3.14 (sec) , antiderivative size = 73, normalized size of antiderivative = 1.16
method | result | size |
parallelrisch | \(-\frac {a \left (A \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )-A \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )-\frac {\sin \left (2 d x +2 c \right ) C}{4}+\left (-B -C \right ) \sin \left (d x +c \right )-x \left (B +\frac {C}{2}+A \right ) d \right )}{d}\) | \(73\) |
derivativedivides | \(\frac {a A \left (d x +c \right )+B a \sin \left (d x +c \right )+a C \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+a A \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+B a \left (d x +c \right )+a C \sin \left (d x +c \right )}{d}\) | \(82\) |
default | \(\frac {a A \left (d x +c \right )+B a \sin \left (d x +c \right )+a C \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+a A \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+B a \left (d x +c \right )+a C \sin \left (d x +c \right )}{d}\) | \(82\) |
parts | \(\frac {a A \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}+\frac {\left (a A +B a \right ) \left (d x +c \right )}{d}+\frac {\left (B a +a C \right ) \sin \left (d x +c \right )}{d}+\frac {a C \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )}{d}\) | \(83\) |
risch | \(a x A +a B x +\frac {a C x}{2}-\frac {i B a \,{\mathrm e}^{i \left (d x +c \right )}}{2 d}-\frac {i a C \,{\mathrm e}^{i \left (d x +c \right )}}{2 d}+\frac {i {\mathrm e}^{-i \left (d x +c \right )} B a}{2 d}+\frac {i {\mathrm e}^{-i \left (d x +c \right )} a C}{2 d}+\frac {a A \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{d}-\frac {a A \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{d}+\frac {\sin \left (2 d x +2 c \right ) a C}{4 d}\) | \(138\) |
norman | \(\frac {\left (B a +\frac {1}{2} a C +a A \right ) x +\left (B a +\frac {1}{2} a C +a A \right ) x \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (3 a A +3 B a +\frac {3}{2} a C \right ) x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (3 a A +3 B a +\frac {3}{2} a C \right ) x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\frac {a \left (2 B +C \right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+\frac {a \left (2 B +3 C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}+\frac {4 a \left (B +C \right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{3}}+\frac {a A \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d}-\frac {a A \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{d}\) | \(207\) |
[In]
[Out]
none
Time = 0.28 (sec) , antiderivative size = 68, normalized size of antiderivative = 1.08 \[ \int (a+a \cos (c+d x)) \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec (c+d x) \, dx=\frac {{\left (2 \, A + 2 \, B + C\right )} a d x + A a \log \left (\sin \left (d x + c\right ) + 1\right ) - A a \log \left (-\sin \left (d x + c\right ) + 1\right ) + {\left (C a \cos \left (d x + c\right ) + 2 \, {\left (B + C\right )} a\right )} \sin \left (d x + c\right )}{2 \, d} \]
[In]
[Out]
\[ \int (a+a \cos (c+d x)) \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec (c+d x) \, dx=a \left (\int A \sec {\left (c + d x \right )}\, dx + \int A \cos {\left (c + d x \right )} \sec {\left (c + d x \right )}\, dx + \int B \cos {\left (c + d x \right )} \sec {\left (c + d x \right )}\, dx + \int B \cos ^{2}{\left (c + d x \right )} \sec {\left (c + d x \right )}\, dx + \int C \cos ^{2}{\left (c + d x \right )} \sec {\left (c + d x \right )}\, dx + \int C \cos ^{3}{\left (c + d x \right )} \sec {\left (c + d x \right )}\, dx\right ) \]
[In]
[Out]
none
Time = 0.20 (sec) , antiderivative size = 82, normalized size of antiderivative = 1.30 \[ \int (a+a \cos (c+d x)) \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec (c+d x) \, dx=\frac {4 \, {\left (d x + c\right )} A a + 4 \, {\left (d x + c\right )} B a + {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} C a + 4 \, A a \log \left (\sec \left (d x + c\right ) + \tan \left (d x + c\right )\right ) + 4 \, B a \sin \left (d x + c\right ) + 4 \, C a \sin \left (d x + c\right )}{4 \, d} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 131 vs. \(2 (59) = 118\).
Time = 0.35 (sec) , antiderivative size = 131, normalized size of antiderivative = 2.08 \[ \int (a+a \cos (c+d x)) \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec (c+d x) \, dx=\frac {2 \, A a \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 2 \, A a \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) + {\left (2 \, A a + 2 \, B a + C a\right )} {\left (d x + c\right )} + \frac {2 \, {\left (2 \, B a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + C a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 2 \, B a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 3 \, C a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{2}}}{2 \, d} \]
[In]
[Out]
Time = 1.62 (sec) , antiderivative size = 159, normalized size of antiderivative = 2.52 \[ \int (a+a \cos (c+d x)) \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec (c+d x) \, dx=\frac {B\,a\,\sin \left (c+d\,x\right )}{d}+\frac {C\,a\,\sin \left (c+d\,x\right )}{d}+\frac {2\,A\,a\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {2\,B\,a\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {C\,a\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {C\,a\,\sin \left (2\,c+2\,d\,x\right )}{4\,d}-\frac {A\,a\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,1{}\mathrm {i}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,2{}\mathrm {i}}{d} \]
[In]
[Out]